import React from 'react';
import { TouchableOpacity, Text, StyleSheet } from 'react-native';
const Link = ({ active, children, onClick }) => {
  if (active) {
    return <Text style={styles.green}>{children}</Text>;
  }
  return (
    <TouchableOpacity
      onPress={() => {
        onClick();
      }}>
      <Text>{children}</Text>
    </TouchableOpacity>
  );
};

const styles = StyleSheet.create({
  green: {
    color: 'green',
  },
});

export default Link;
